<?php
	/**
     *  This file performs redirection to article creation page
     */
	include_spip('functions/pdk_common');
	$ecatalogue = pdk_load_class('Ecatalogue','classes'); 
	 
	if (!($id_rubrique = _request('id_rubrique')) || !$ecatalogue->IsEcatalogueRubrique(_request('id_rubrique'))) {		
		$id_rubrique = $ecatalogue->FindFirstRubriqueId();
	}
	
	include_spip('inc/headers');
	if ($id_rubrique) {
		redirige_url_ecrire('articles_edit', 'id_rubrique='.$id_rubrique.'&new=oui');
	} else
		redirige_url_ecrire('ecatalogue_products');
	
?>